<?php
/**
* Display the transaction edition screen
*
* @author       Fabrice Douteaud <clearbudget@douteaud.com>
* @package      snippets
* @access       public
*/

/***********************************************************************

  Copyright (C) 2008  Fabrice douteaud (clearbudget@douteaud.com)

    This file is part of ClearBudget.

    ClearBudget is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ClearBudget is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ClearBudget.  If not, see <http://www.gnu.org/licenses/>.


************************************************************************/

?>
<div class="title"><?php echo $keys->pageTitle_EditItem; ?></div><br/>
<form>
<input type="hidden" name="action" value="itemEditSubmit">
<table class="tableReport" onMouseOver="javascript:trackTableHighlight(event, '#E6EAE9');" onMouseOut="javascript:highlightTableRow(0);">
<caption>Edit this transaction information. <a href=#" action="listCategoryItems_categorySelected='.$_GET['id'].'_backAction=tableCredits">Back</a></caption>
<tr>
  <th><?php echo $keys->text_settingName; ?></th>
  <th><?php echo $keys->text_settingInput; ?></th>
</tr>
<tr><td><?php echo $keys->text_operationDate; ?></td>
<td><?php echo $result['operationDate']?></td></tr>
<tr><td><?php echo $keys->text_amountLong; ?></td>
<td><?php echo $result['amount']?> (<?php echo class_settings::$currency?>)</td></tr>
<tr><td><?php echo $keys->text_payee; ?></td>
<td><?php echo $result['payee']?></td></tr>
<tr><td><?php echo $keys->text_memo; ?></td>
<td><?php echo $result['memo']?></td></tr>
<tr><td><?php echo $keys->text_commentsLong; ?></td>
<td><input type="text" size="50" value="<?php echo $result['comments']?>" name="comment" id="comment"></td></tr>
<tr><td><?php echo $keys->text_categoryNameLong; ?></td>
<td><select id="category" class="selectCategory"><option value="0"><?php echo $keys->link_pickInTheList ?></option>
<?php foreach($categories as $id=>$name){
    echo '<option value="'.$id.'"';
    if($result['category'] == $id) echo ' selected="selected"';
    echo '>'.$name.'</option>';
    }
?>
</select></td></tr>
<tr><td colspan="2"  style="text-align:center" ><a href="#" editItem="true" id="<?php echo $transactionId; ?>"><?php echo $keys->link_save; ?></a></td></tr>
</table>
</form>
